package Test1;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String num=sc.nextLine();
        StringBuffer buffer=new StringBuffer(num);
        int modecount=0;
        if(num.length() == 1){
            System.out.println(modecount);
                    return;
        }
        for (int i = 0; i < num.length()-1; i++) {
            int j=i+1;
            if (buffer.charAt(j) == buffer.charAt(i)){
                buffer.setCharAt(j,'0');
                modecount++;
            }
        }
        System.out.println(modecount);
    }
}
